import request from '@/utils/request'

// 获取课程分类分页列表
export function getCategoryPage(params) {
  return request({
    url: '/courseCategory/page',
    method: 'get',
    params
  })
}

// 添加课程分类
export function addCategory(data) {
  return request({
    url: '/courseCategory/add',
    method: 'post',
    data
  })
}

// 更新课程分类
export function updateCategory(data) {
  return request({
    url: '/courseCategory/update',
    method: 'post',
    data
  })
}

// 删除课程分类
export function deleteCategory(categoryId) {
  return request({
    url: `/courseCategory/delete/${categoryId}`,
    method: 'post'
  })
}

// 修改课程分类状态
export function changeCategoryStatus(categoryId, isVisible) {
  return request({
    url: `/courseCategory/status/${categoryId}`,
    method: 'post',
    params: { isVisible }
  })
}